﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

	<!-- ScrollBarPageButton -->
	<Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Border Background="{DynamicResource transparentBackGround}" />
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- VerticalScrolScrollBarThumblBar -->
	<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Border 
          CornerRadius="4" 
          Background="Black"
          BorderBrush="Black"
          BorderThickness="1" />
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- VerticalScrollBar -->
	<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
		<Grid Background="{DynamicResource transparentBackGround}" >
			<Grid.RowDefinitions>
				<RowDefinition Height="0.00001*"/>
			</Grid.RowDefinitions>
			<Border
      Grid.RowSpan="1"
      CornerRadius="2" 
      Background="{DynamicResource transparentBackGround}" />
			<Track
      Name="PART_Track"
      Grid.Row="1"
      IsDirectionReversed="true">
				<Track.DecreaseRepeatButton>
					<RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageUpCommand" />
				</Track.DecreaseRepeatButton>
				<Track.Thumb>
					<Thumb Name="thumb"
          Style="{StaticResource ScrollBarThumb}" 
          Margin="3,0,3,0"  
          Background="Black"
          BorderBrush="Black" />
				</Track.Thumb>
				<Track.IncreaseRepeatButton>
					<RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageDownCommand" />
				</Track.IncreaseRepeatButton>

			</Track>
		</Grid>

	</ControlTemplate>

	<!-- HorizontalScrollBar -->
	<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
		<Grid Background="{DynamicResource transparentBackGround}" >
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.00001*"/>
			</Grid.ColumnDefinitions>
			<Border
      Grid.ColumnSpan="1"
      CornerRadius="2" 
      Background="{DynamicResource transparentBackGround}" />
			<Track 
      Name="PART_Track"
      Grid.Column="1"
      IsDirectionReversed="False">
				<Track.DecreaseRepeatButton>
					<RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageLeftCommand" />
				</Track.DecreaseRepeatButton>
				<Track.Thumb>
					<Thumb Name="thumb"
          Style="{StaticResource ScrollBarThumb}" 
          Margin="0,3,0,3"  
          Background="Black"
          BorderBrush="Black" />
				</Track.Thumb>
				<Track.IncreaseRepeatButton>
					<RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageRightCommand" />
				</Track.IncreaseRepeatButton>
			</Track>
		</Grid>
	</ControlTemplate>

	<!-- ScrollBar -->
	<Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Style.Triggers>
			<Trigger Property="Orientation" Value="Horizontal">
				<Setter Property="Width" Value="Auto"/>
				<Setter Property="Height" Value="14" />
				<Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
			</Trigger>
			<Trigger Property="Orientation" Value="Vertical">
				<Setter Property="Width" Value="14"/>
				<Setter Property="Height" Value="Auto" />
				<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
			</Trigger>
		</Style.Triggers>
	</Style>

	<!-- ScrollViewerStyle -->
	<Style TargetType="{x:Type ScrollViewer}">
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="HorizontalScrollBarVisibility" Value="Visible" />
		<Setter Property="VerticalScrollBarVisibility" Value="Visible" />
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="ContextMenu" Value="{x:Null}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ScrollViewer}">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="Auto"/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="*"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>

						<ScrollContentPresenter Grid.Column="0"/>

						<ScrollBar Name="PART_VerticalScrollBar"
                            Grid.Column="1"
                            Value="{TemplateBinding VerticalOffset}"
                            Maximum="{TemplateBinding ScrollableHeight}"
                            ViewportSize="{TemplateBinding ViewportHeight}"
                            Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
						<ScrollBar Name="PART_HorizontalScrollBar"
                            Orientation="Horizontal"
                            Grid.Row="1"
                            Grid.Column="0"
                            Value="{TemplateBinding HorizontalOffset}"
                            Maximum="{TemplateBinding ScrollableWidth}"
                            ViewportSize="{TemplateBinding ViewportWidth}"
                            Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>